﻿using System.Collections.Generic;

namespace Tatibah
{
    /// <summary>
    /// This class represents a Page Header
    /// </summary>
    public class Header : BaseHeaderFooter
    {

        /// <summary>
        /// Construct a Header from Multiple Items. Items can be Paragraphs, NumberedLists and Tables
        /// </summary>
        /// <param name="MultipleItems"></param>
        public Header(params iDocumentAppend[] MultipleItems)
        {
            foreach (iCellAppend item in MultipleItems)
            {
                if (item.GetType() == typeof(Paragraph))
                {
                    HeaderFooterContent content = new HeaderFooterContent((Paragraph)item);
                    contents.Add(content);
                }
                else if (item.GetType() == typeof(Table))
                {
                    HeaderFooterContent content = new HeaderFooterContent((Table)item);
                    contents.Add(content);
                }
                else if (item.GetType() == typeof(NumberedList))
                {
                    HeaderFooterContent content = new HeaderFooterContent((NumberedList)item);
                    contents.Add(content);
                }
            }
        }

       

        /// <summary>
        /// Append Multiple Items to a Header. Items can be Paragraphs, NumberedLists and Tables
        /// </summary>
        /// <param name="MultipleItems"></param>
        public void Append(params iDocumentAppend[] MultipleItems)
        {
            foreach (iCellAppend item in MultipleItems)
            {
                if (item.GetType() == typeof(Paragraph))
                {

                    HeaderFooterContent content = new HeaderFooterContent((Paragraph)item);
                    contents.Add(content);
                }
                else if (item.GetType() == typeof(Table))
                {
                    HeaderFooterContent content = new HeaderFooterContent((Table)item);
                    contents.Add(content);
                }
                else if (item.GetType() == typeof(NumberedList))
                {
                    HeaderFooterContent content = new HeaderFooterContent((NumberedList)item);
                    contents.Add(content);
                }
            }
        }
    }
}
